﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ODataRegression.Framework.Core.TestOM;
using ODataRegression.Framework.Core.MetaDataOM;
using ODataRegression.Framework.Core.Shared;
using System.Text.RegularExpressions;
using System.ComponentModel;
using System.Xml;
using ODataTestFrameworkCore.shared;

namespace ODataRegression.Framework.Core.Factories
{
    public class ODataInlineCountTestFactory : ODataTestFactoryBase
    {
        //int maxTestGenerationCount;
        //int generatedTestCount;
        //Regex verificationToken;
        public override List<ODataTest> CreateTestList()
        {
            //List<ODataTest> testList = new List<ODataTest>();
            EntityBaseURL = entitySet.URL;
            QueryURLBase = EntityBaseURL + "?$inlinecount=allpages";
            testName = ODataTestNames.InlineCount;
            testTile = "Verify that $inlinecount is working for selected entity";

            //verificationToken = new Regex("<m:properties>");
            // If test type not defined in config then return null
            if (this.ISAvtiveTest)
            {
                FinalQueryURL = QueryURLBase + "&$top=1";
                FinalQueryURL = URLMappers.ApplyConfigMappingActions(FinalQueryURL);

                base.CreateTestList();
                //testList.Add(new ODataTest(serviceRoot, this.ServiceName, entitySet.CollectionName, entitySet.Entity.Name, testName, testTile, FinalQueryURL, UriResultType.Feed, verificationToken ));

            }
            return testList;
        }

        public ODataInlineCountTestFactory(string serviceRoot, string ServiceName, ODataEntitySet entityset )
            : base(serviceRoot, ServiceName, entityset )
        {
            //this.entitySet = entityset;
            //this.ServiceName = ServiceName;
            //this.serviceRoot = serviceRoot;
            //this.testConfig = testConfig;

        }
    }
}

